# -*- coding: utf-8 -*-
"""
Created on Thu May 23 10:59:59 2024

@author: Administrator
"""
def gcd(x, y):
    """求最大公约数"""
    (x, y) = (y, x) if x > y else (x, y)
    for factor in range(x, 0, -1):
        if x % factor == 0 and y % factor == 0:
            return factor
